#ifndef WATCHDOG_HPP
#define WATCHDOG_HPP

#include <QObject>
#include <QTimer>

#include "datamemoryorganisation.hpp"

/**
* @brief
*
* @class Watchdog watchdog.hpp "watchdog.hpp"
*/
class Watchdog : public QObject
{
Q_OBJECT
public:

    const int MAX_WATCHDOG_TIMER;
    /**
    * @brief
    *
    * @fn Watchdog
    * @param parent
    */
    explicit Watchdog(DataMemoryOrganisation *dmo, QObject *parent = 0);

    /**
    * @brief Resets the Watchdog Timer
    *
    * @fn clearWatchdogTimer
    */
    void clearWatchdogTimer();

    /**
    * @brief Increments the Watchdog Timer
    *
    * @fn incrementWatchdogTimer
    */
    void incrementWatchdogTimer();

    bool isWatchdogEnabled();

    void setWatchdogEnabled(bool ena);

    /**
    * @brief Returns the current timer value as String
    *
    * @fn getWatchdogValue
    * @return int
    */
    QString toString();

private:

    int timer;
    bool watchdogEnabled;
    DataMemoryOrganisation *dataMemoryOrganisation;

signals:

    void watchdogTimeout();


public slots:

};

#endif // WATCHDOG_HPP
